﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using Blog.DataAccess;
using Blog.Entity;

namespace Blog
{
    public partial class MasterPage : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ButtonLogOn.Click+=new EventHandler(ButtonLogOn_Click);
        }

        protected void ButtonLogOn_Click(object sender, EventArgs e)
        {
            LogOn logOn=new LogOn(TextBoxUser.Text,TextBoxPassword.Text);
            if (logOn.IsLoged)
            {
                Session["sesLogOn"] = logOn;
                TextBoxUser.Enabled = false;
                TextBoxPassword.Visible = false;
                ButtonLogOn.Visible = false;
            }
            else
            {
                LableError.Text = logOn.Message;
            }
        }
    }
}
